package com.primb.bench.project.home.entity;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * Created by Chen on 2017/5/9.
 * 功能描述：担保物实体类
 */

public class EnsureObjectEntity implements Parcelable {

    /**
     * guatantCode :
     * guatantDesc :  //担保方式
     * guatantId : 0000002017080410331004
     * pawnAmt : 100000
     * pawnCode : 010010
     * pawnDesc : 抵押-房产  //担保物类型
     */

    private String guatantCode;
    private String guatantDesc;
    private String guatantId;
    private String pawnAmt;
    private String pawnCode;
    private String pawnDesc;
    boolean isEnsureObjectEmpty = true;

    public boolean isEnsureObjectEmpty() {
        return isEnsureObjectEmpty;
    }

    public void setEnsureObjectEmpty(boolean ensureObjectEmpty) {
        isEnsureObjectEmpty = ensureObjectEmpty;
    }

    public String getGuatantCode() {
        return guatantCode;
    }

    public void setGuatantCode(String guatantCode) {
        this.guatantCode = guatantCode;
    }

    public String getGuatantDesc() {
        return guatantDesc;
    }

    public void setGuatantDesc(String guatantDesc) {
        this.guatantDesc = guatantDesc;
    }

    public String getGuatantId() {
        return guatantId;
    }

    public void setGuatantId(String guatantId) {
        this.guatantId = guatantId;
    }

    public String getPawnAmt() {
        return pawnAmt;
    }

    public void setPawnAmt(String pawnAmt) {
        this.pawnAmt = pawnAmt.replace(",", "");
    }

    public String getPawnCode() {
        return pawnCode;
    }

    public void setPawnCode(String pawnCode) {
        this.pawnCode = pawnCode;
    }

    public String getPawnDesc() {
        return pawnDesc;
    }

    public void setPawnDesc(String pawnDesc) {
        this.pawnDesc = pawnDesc;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(this.guatantCode);
        dest.writeString(this.guatantDesc);
        dest.writeString(this.guatantId);
        dest.writeString(this.pawnAmt);
        dest.writeString(this.pawnCode);
        dest.writeString(this.pawnDesc);
        dest.writeByte(this.isEnsureObjectEmpty ? (byte) 1 : (byte) 0);
    }

    public EnsureObjectEntity() {
    }

    protected EnsureObjectEntity(Parcel in) {
        this.guatantCode = in.readString();
        this.guatantDesc = in.readString();
        this.guatantId = in.readString();
        this.pawnAmt = in.readString();
        this.pawnCode = in.readString();
        this.pawnDesc = in.readString();
        this.isEnsureObjectEmpty = in.readByte() != 0;
    }

    public static final Creator<EnsureObjectEntity> CREATOR = new Creator<EnsureObjectEntity>() {
        @Override
        public EnsureObjectEntity createFromParcel(Parcel source) {
            return new EnsureObjectEntity(source);
        }

        @Override
        public EnsureObjectEntity[] newArray(int size) {
            return new EnsureObjectEntity[size];
        }
    };
}
